<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt'%>

<form id="pagerForm" method="post" action="app/project/base.do?action=dialogProjectMaterialRepository">
	<input type="hidden" name="pageNum" value="${pagingBean ne null ? pagingBean.currentPage : 1}" />
	<input type="hidden" name="numPerPage" value="${pagingBean ne null ? pagingBean.pageSize : 20}" />
</form>

<!-- Body -->
<div class="pageContent">
	<table class="table" width="100%" layoutH="55">
		<thead>
			<tr>
				<th align="center">序号</th>
				<th align="center">文件名</th>
				<th align="center">文件大小</th>
				<th align="center">上传人员</th>
				<th align="center">上传时间</th>
				<th align="center">文件创建时间</th>
				<th align="center">文件下载</th>
			</tr>
		</thead>
		<tbody>
			<logic:present name="material" property="metas">
				<logic:iterate name="material" property="metas" id="entity" indexId="idx">
					<tr>
						<td>${idx+1}</td>
						<td style="text-align: left">${entity.attachment.fileName}</td>
						<td style="text-align: right">${entity.attachment.note}</td>
						<td style="text-align: left">${entity.poster ne null ? entity.poster.username : '---'}</td>
						<td><fmt:formatDate value="${entity.postTime}" type="date" pattern="yyyy-MM-dd"/></td>
						<td><fmt:formatDate value="${entity.creationTime}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/></td>
						<td>
							<a href="file-download?path=${entity.attachment.filePath}&filename=${entity.attachment.fileName}" target="_blank" class="oplink">下载</a>
						</td>
					</tr>
				</logic:iterate>
			</logic:present>
		</tbody>
	</table>
</div>

<div class="formBar">
	<ul>
		<li>
			<div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
		</li>
	</ul>
</div>